﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Gallery.aspx.cs" Inherits="VCN.home.Gallery"
    Title="Gallery" %>

<%@ Register Src="UC/GalleryMenuUC.ascx" TagName="GalleryMenuUC" TagPrefix="uc1" %>
<%@ Register Src="UC/ProductSlide.ascx" TagName="ProductSlide" TagPrefix="uc2" %>
<%@ Register Src="UC/LogoUC.ascx" TagName="LogoUC" TagPrefix="uc3" %>
<%@ Register Src="UC/GetInTouchUC.ascx" TagName="GetInTouchUC" TagPrefix="uc4" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <link rel="stylesheet" type="text/css" href="Style/slideshow.css" media="screen" />
    <script type="text/javascript" src="JS/jquery.js"></script>
    <script type="text/javascript" src="JS/scripts.js"></script>
    <link href="Style/home.css" rel="stylesheet" type="text/css" />
    <link href="Style/Menu.css" rel="stylesheet" type="text/css" />
    <link href="Style/Menu_doc.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="Style/productslide.css" type="text/css" media="screen"
        charset="utf-8" />
    <link href="Style/galleria.classic.css" rel="stylesheet" type="text/css" />
    <!-- load jQuery -->
    <%--    <script type="text/javascript" src="js/jquery.js"></script>--%>
    <!-- load Galleria -->
    <%-- <script type="text/javascript" src="js/galleria-1.2.7.min.js"></script>--%>
    <!-- load slide doc-->
    <%--    <link href="Style/style1.css" rel="stylesheet" type="text/css" />--%>
    <link rel="stylesheet" type="text/css" href="skins/tango/skin.css" />
    <link rel="stylesheet" type="text/css" href="skins/ie7/skin.css" />
    <script type="text/javascript" src="JS/jquery.min.js"></script>
    <script type="text/javascript" src="JS/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="JS/jquery.jcarousel.min.js"></script>
    <script type="text/javascript">
jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        vertical: true,
		wrap: 'circular',
        scroll: 2,
		    });
});
    </script>
    <script type="text/javascript">
        jQuery(document).ready(function () {
            // Initialise the first and second carousel by class selector.
            // Note that they use both the same configuration options (none in this case).
            jQuery('.first-and-second-carousel').jcarousel();

            // If you want to use a caoursel with different configuration options,
            // you have to initialise it seperately.
            // We do it by an id selector here.
            jQuery('#third-carousel').jcarousel({
                vertical: true
            });
        });

    </script>
    <link rel="stylesheet" href="Style/style.css" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div id="top">
        <div id="header-top">
            <div id="header-top-left">
                Subscribe to: <span>Posts</span> | <span>Comments</span> | <span>Email</span>
            </div>
            <!-- end header-left -->
            <div id="header-top-right">
                <div id="sbox">
                    <input type="text" class="search-box" />
                </div>
                <!-- end sbox -->
                <div id="social-net">
                    <img src="/home/Images/bgnd/rss.png" alt="rss" />
                    <img src="/home/Images/bgnd/fb.png" alt="fb" />
                    <img src="/home/Images/bgnd/twitter.png" alt="tt" />
                </div>
                <!-- end social-net -->
            </div>
        </div>
    </div>
    <!-- end top -->
    <div id="header">
        <table>
            <tr>
                <td class="logo" valign="middle">
                    <uc3:LogoUC ID="LogoUC1" runat="server" />
                </td>
                <td class="menu" valign="top">
                    <div class="menu1">
                        <a href="/home/Contact.aspx">Contact</a></div>
                    <div class="menu1">
                        <a href="/home/ListNews.aspx">News</a></div>
                    <div class="menu1">
                        <a href="/home/Gallery.aspx" id="selected">Gallery</a></div>
                    <div class="menu1">
                        <a href="/home/About.aspx">About </a>
                    </div>
                    <div class="menu1">
                        <a href="/home/default.aspx">Home</a></div>
                </td>
            </tr>
        </table>
    </div>
    <!-- end header -->
    <div id="slideshow">
        <!--/top-->
        <div id="dau">
            <div class="wrap">
                <div id="slide-holder">
                    <div id="slide-runner">
                        <a href="">
                            <img id="slide-img-1" src='<%="Images/SlideShow/"+get_image_slide(1)%>' class="slide"
                                alt="" /></a> <a href="">
                                    <img id="slide-img-2" src='<%="Images/SlideShow/"+get_image_slide(2)%>' class="slide"
                                        alt="" /></a> <a href="">
                                            <img id="slide-img-3" src='<%="Images/SlideShow/"+get_image_slide(3)%>' class="slide"
                                                alt="" /></a> <a href="">
                                                    <img id="slide-img-4" src='<%="Images/SlideShow/"+get_image_slide(4)%>' class="slide"
                                                        alt="" /></a> <a href="">
                                                            <img id="slide-img-5" src='<%="Images/SlideShow/"+get_image_slide(5)%>' class="slide"
                                                                alt="" /></a> <a href="">
                                                                    <img id="slide-img-6" src='<%="Images/SlideShow/"+get_image_slide(6)%>' class="slide"
                                                                        alt="" /></a> <a href="">
                                                                            <img id="slide-img-7" src='<%="Images/SlideShow/"+get_image_slide(7)%>' class="slide"
                                                                                alt="" /></a>
                        <div id="slide-controls">
                            <p id="slide-client" class="text">
                                <strong></strong><span></span>
                            </p>
                            <p id="slide-desc" class="text">
                            </p>
                            <p id="slide-nav">
                            </p>
                        </div>
                    </div>
                    <!--content featured gallery here -->
                </div>
                <script type="text/javascript">
                    if (!window.slider) var slider = {}; slider.data = [{ "id": "slide-img-1", "client": "", "desc": "" }, { "id": "slide-img-2", "client": "", "desc": "" }, { "id": "slide-img-3", "client": "", "desc": "" }, { "id": "slide-img-4", "": "", "desc": "" }, { "id": "slide-img-5", "client": "", "desc": "" }, { "id": "slide-img-6", "client": "", "desc": "" }, { "id": "slide-img-7", "client": "", "desc": ""}];
                </script>
            </div>
        </div>
        <!--/header-->
    </div>
    <!-- end slideshow -->
    <br />
    <div id="wrapper">
        <div id="left_wrapper">
            <div id="gallery_menu">
                <uc1:GalleryMenuUC ID="GalleryMenuUC1" runat="server" />
            </div>
            <div id="get_in_touch">
                <uc4:GetInTouchUC ID="GetInTouchUC1" runat="server" />
            </div>
        </div>
        <!--left wrapper -->
        <div id="right_wrapper">
            <div class="left_content">
                <div id="slideshow_gallery">
                    <ul id="gallery_slideshow">
                        <% 
                            int product_id;
                            int v_id;
                            try
                            {
                                if (Request.QueryString["product_id"] == null)
                                {
                                    if (Request.QueryString["id"] == null) v_id = GetId();
                                    else v_id = int.Parse(Request.QueryString["id"]);
                                    product_id = GetProductId(v_id);

                                }
                                else
                                    product_id = int.Parse(Request.QueryString["product_id"].ToString());
                            }
                            catch (Exception ex)
                            {
                                throw;

                                //  throw MessageBox.Show(ex.ToString());
                            }
                            VCN.App.DataAccessLayer.RelativeProductDAO v_RelativeProductDAO = new VCN.App.DataAccessLayer.RelativeProductDAO();
                            if (product_id != 0)
                            {
                                System.Data.DataTable v_dt = v_RelativeProductDAO.SelectByProductId(product_id);
                                int m_RelativeProductCount = v_dt.Rows.Count;
                                VCN.App.DataAccessLayer.ProductDAO v_ProDAO = new VCN.App.DataAccessLayer.ProductDAO();
                                string v_image_product = v_ProDAO.SelectById(product_id).Image;
                                Response.Write(string.Format("<li name='gallery_li'><h3></h3><span>../Images/Product/"));
                                Response.Write(string.Format(v_image_product));
                                Response.Write(string.Format(string.Concat("</span><p></p><a href='#'><img name='gallery_img' title='", v_ProDAO.SelectById(product_id).Name, "' src='../Images/Product/")));
                                Response.Write(string.Format(v_image_product));
                                Response.Write(string.Format("'/></a></li>"));
                                for (int i = 0; i < m_RelativeProductCount; i++)
                                {
                                    Response.Write(string.Format("<li name='gallery_li'><h3></h3><span>../Images/Product/"));
                                    Response.Write(string.Format(v_dt.Rows[i]["RELATIVE_PRODUCT_IMAGE"].ToString()));
                                    Response.Write(string.Format(string.Concat("</span><p></p><a href='#'><img name='gallery_img' title='", v_dt.Rows[i]["RELATIVE_PRODUCT_NAME"].ToString(), "' src='../Images/Product/")));
                                    Response.Write(string.Format(v_dt.Rows[i]["RELATIVE_PRODUCT_IMAGE"].ToString()));
                                    Response.Write(string.Format("'/></a></li>"));
                                }
                            }
                        %>
                        <%--<li name="gallery_li">
			<h3></h3>
			<span>../Images/Product/image1.jpg</span>
			<p></p>
			<a href="#"><img title="keke" src="../Images/Product/image1.jpg" alt="Orange Fish" /></a>
		</li>--%>
                    </ul>
                    <div id="slide_wrapper">
                        <div id="fullsize">
                            <div id="imgprev" class="imgnav" title="Previous Image">
                            </div>
                            <div id="imglink">
                            </div>
                            <div id="imgnext" class="imgnav" title="Next Image">
                            </div>
                            <div id="image">
                            </div>
                            <div id="information">
                                <p>
                                </p>
                            </div>
                        </div>
                        <div id="photos">
                            <div id="slideleft" title="Slide Left">
                            </div>
                            <div id="slidearea">
                                <div id="slider">
                                </div>
                            </div>
                            <div id="slideright" title="Slide Right">
                            </div>
                        </div>
                    </div>
                </div>
                <!--end slideshow-->
                <script type="text/javascript" src="JS/compressed.js"></script>
                <script type="text/javascript">
                    $('gallery_slideshow').style.display = 'none';
                    $('slide_wrapper').style.display = 'block';
                    var slideshow1 = new TINY.slideshow1("slideshow1");
                    window.onload = function () {
                        slideshow1.auto = true;
                        slideshow1.speed = 5;
                        slideshow1.link = "linkhover";
                        slideshow1.info = "information";
                        slideshow1.thumbs = "slider";
                        slideshow1.left = "slideleft";
                        slideshow1.right = "slideright";
                        slideshow1.scrollSpeed = 4;
                        slideshow1.spacing = 5;
                        slideshow1.active = "#fff";
                        slideshow1.init("slideshow1", "image", "imgprev", "imgnext", "imglink");
                    }
                </script>
            </div>
            <!-- end left_content -->
            <div class="right_content">
                <ul id="mycarousel" class="jcarousel jcarousel-skin-tango">
                    <%        
                        int id;
                        try
                        {
                            if (Request.QueryString["id"] == null) id = GetId();
                            else
                                id = int.Parse(Request.QueryString["id"].ToString());
                        }
                        catch (Exception ex)
                        {
                            throw;

                            //  throw MessageBox.Show(ex.ToString());
                        }
                        VCN.App.DataAccessLayer.ProductDAO v_ProductDAO = new VCN.App.DataAccessLayer.ProductDAO();
                        if (id != 0)
                        {
                            System.Data.DataTable v_data = v_ProductDAO.SelectByCategoryId(id);
                            int m_ProductCount = v_data.Rows.Count;
                            for (int i = 0; i < ((m_ProductCount + 1) / 2); i++)
                            {
                                Response.Write(string.Format("<li><div style='width:155px; height:65'>"));
                                Response.Write(string.Format(string.Concat("<a title='", v_data.Rows[i * 2]["PRODUCT_KEY"].ToString(), "' href='Gallery.aspx?product_id=", v_data.Rows[i * 2]["ID"].ToString(), "&id=", id, "'><img border='1' width='75' height='65' style='float:left'  alt='' src='../Images/Product/")));
                                Response.Write(string.Format(string.Concat(v_data.Rows[i * 2]["PRODUCT_IMAGE"].ToString(), "'>")));
                                Response.Write(string.Format("</a>"));
                                if (2 * i + 1 <= m_ProductCount - 1)
                                {
                                    Response.Write(string.Format(string.Concat("<a title='", v_data.Rows[i * 2 + 1]["PRODUCT_KEY"].ToString(), "' href='Gallery.aspx?product_id=", v_data.Rows[i * 2 + 1]["ID"].ToString(), "&id=", id, "'><img border='1' width='75' height='65' style='float:right'  alt='' src='../Images/Product/")));
                                    Response.Write(string.Format(string.Concat(v_data.Rows[i * 2 + 1]["PRODUCT_IMAGE"].ToString(), "'>")));
                                    Response.Write(string.Format("</a>"));
                                }
                                Response.Write(string.Format("</div></li>"));
                            }
                        }
                    %>
                </ul>
            </div>
        </div>
        <!-- end right_wrapper -->
    </div>
    <!-- end wrapper -->
    <br />
    <!-- start bottom -->
    <div id="bottom">
        <!-- start footer -->
        <div id="footer">
            <div id="copyright">
                <span id="s1">&#169; 2011 Copyright VCN Theme. Powered by BKIndex Group. All Rights
                    Reserved.</span> <span id="s2">Privacy Policy | Terms and Conditions | Contact Us |
                        Back to Top</span>
            </div>
        </div>
        <!-- end footer -->
    </div>
    <!-- end bottom -->
    </form>
</body>
</html>
